/**
 * Copyright (C) BFH www.bfh.ch 2011
 * Code written by: Patrick Dobler, Marc Folly
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ch.bfh.ti.kybernetik.simulator.model;

import javax.vecmath.Vector2d;

public class Roboter implements Cloneable {

	private Motor leftMotor;

	private Motor rightMotor;

	private int leftLightSensor;

	private int rightLightSensor;

	private double x;

	private double y;

	private Vector2d direction;

	public Roboter(double x, double y, Motor leftMotor, Motor rightMotor, Vector2d dirVector2d) {
		this.x = x;
		this.y = y;
		this.leftMotor = leftMotor;
		this.rightMotor = rightMotor;
		this.direction = dirVector2d;
	}

	public Roboter(Roboter r) {
		this.x = r.getX();
		this.y = r.getY();
		this.leftLightSensor = r.getLeftLightSensor();
		this.rightLightSensor = r.getRightLightSensor();
		this.leftMotor = new Motor(r.getLeftMotor());
		this.rightMotor = new Motor(r.getRightMotor());
		this.direction = new Vector2d(r.getDirection());
	}

	public Motor getLeftMotor() {
		return leftMotor;
	}

	public void setLeftMotor(Motor leftMotor) {
		this.leftMotor = leftMotor;
	}

	public Motor getRightMotor() {
		return rightMotor;
	}

	public void setRightMotor(Motor rightMotor) {
		this.rightMotor = rightMotor;
	}

	public int getLeftLightSensor() {
		return leftLightSensor;
	}

	public void setLeftLightSensor(int leftLightSensor) {
		this.leftLightSensor = leftLightSensor;
	}

	public int getRightLightSensor() {
		return rightLightSensor;
	}

	public void setRightLightSensor(int rightLightSensor) {
		this.rightLightSensor = rightLightSensor;
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	@Override
	public String toString() {
		return "Roboter [leftMotor=" + leftMotor + ", rightMotor=" + rightMotor + ", x=" + x + ", y=" + y + ", direction=" + direction
				+ "]";
	}

	public void setDirection(Vector2d direction) {
		this.direction = direction;
	}

	public Vector2d getDirection() {
		return direction;
	}

}
